import { getRequest, postRequest } from '@/api/instance'
const serve = 'auth/'

export const login = ( data ) => {
  return postRequest( `${serve}oauth/login`, { data, showLoading: false })
}

export const logout = ( data ) => {
  return postRequest( `${serve}oauth/logout`, { data })
}

export const getCaptcha = ( params ) => {
  return getRequest( `${serve}oauth/captcha`, { params, responseType: 'blob' })
}

// 刷新token
export const refreshToken = ( data ) => {
  return postRequest( 'auth/oauth/refresh/token', { data })
}
// 获取剩余有效时间
export const expires = ( data ) => {
  return postRequest( 'auth/oauth/surplus/expires', { data })
}



